import Vue from 'vue'
import Router from 'vue-router'
import Home from '../home/Home.vue'
import Index from "../home/Index";
// import Product from "../home/Product";
// import Detail from "../home/Detail";
// import OrderHome from "../home/OrderHome";
// import OrderList from "../home/OrderList";
// import Cart from "../home/Cart";
// import OrderConfirm from "../home/OrderConfirm";
// import OrderPay from "../home/OrderPay";
// import Login from "../home/Login";
// import AliPay from "../home/AliPay";
Vue.use(Router);
const homeRoutes = [
    {
        path:'/',
        name:'Home',
        component:Home,
        meta: {type:'home'},
        redirect:'/index',
        children:[
            {
                path:'/index',
                name:'Index',
                component:Index
            },
            {
                path:'/product/:id',
                name:'Product',
                component:() => import('./../home/Product')
            },
            {
                path:'/detail/:id',
                name:'Detail',
                component:() => import('./../home/Detail')
            }
        ]
    },
    {
        path:'/cart',
        name:'Cart',
        component:() => import('./../home/Cart')
    },
    {
        path:'/login',
        name:'Login',
        component:() => import('./../home/Login')
    },
    {
        path:'/order',
        name:'Order',
        component:() => import('./../home/OrderHome'),
        children: [
            {
                path:'list',
                name:'order-list',
                component:() => import('./../home/OrderList')
            },
            {
                path:'confirm',
                name:'order-confirm',
                component:() => import('./../home/OrderConfirm')
            },
            {
                path:'pay',
                name:'order-pay',
                component:() => import('./../home/OrderPay')
            },
            {
                path:'aliPay',
                name:'ali-pay',
                component:() => import('./../home/AliPay')
            }
        ]
    }



]
export default new Router({
    mode:'history',
    routes:homeRoutes
})
